//
//  OpenCourseInfoViewController.m
//  xpkc
//
//  Created by TopSage on 15/9/30.
//  Copyright (c) 2015年 TopSage. All rights reserved.
//

#import "OpenCourseInfoViewController.h"

@interface OpenCourseInfoViewController ()

@end

@implementation OpenCourseInfoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    

    [self creatInfoView];
}

- (void)creatInfoView{
    
    [self requestInfo];
}

#pragma mark - request
- (void)requestInfo{
    
    
    NSString *module = @"openCourse";
    NSString *interface = @"videodetail";
    
    NSString *timeString = [GetTime getTime];
    NSString *hashString = [[NSString stringWithFormat:@"%@/%@/key/%@/time/%@",module,interface,KEY,timeString] md5];
    NSString *urlString = [NSString stringWithFormat:@"%@/laravel/public/%@/%@/hash/%@/appid/1",URL2,module,interface,hashString];
    
    NSDictionary *parameter = @{@"time":timeString,@"id":self.videoId};
    
    //POST请求
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    [manager POST:urlString parameters:parameter success:^(AFHTTPRequestOperation *operation, id responseObject) {
        //
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        logdebug(@"----------------%@",dic);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        //
    }];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
